﻿using System;
using System.Windows;
using System.Windows.Controls;

namespace KYKJ.Monitor.PlayBack
{
    /// <summary>
    /// PlayBackControl.xaml 的交互逻辑
    /// </summary>
    public partial class PlayBackControl : UserControl
    {
        #region 字段

        /// <summary>
        /// 速度
        /// </summary>
        private int m_speed = 1;

        #endregion

        #region 属性



        #endregion

        #region 构造函数

        public PlayBackControl()
        {
            InitializeComponent();
            DatePickerStart.SelectedDate = DateTime.Now;
            DatePickerEnd.SelectedDate = DateTime.Now;
        }

        #endregion

        #region 公开方法

        /// <summary>
        /// 重启状态
        /// </summary>
        public void ReStartState()
        {

        }

        public void SaveState()
        {

        }

        public void Exit()
        {
            
        }

        #endregion

        private void btnQuery_Click(object sender, RoutedEventArgs e)
        {

        }

        #region 播放按钮事件

        private void btnPlay_Click(object sender, RoutedEventArgs e)
        {

        }

        private void btnPause_Click(object sender, RoutedEventArgs e)
        {

        }

        private void btnStop_Click(object sender, RoutedEventArgs e)
        {

        }

        private void btnSlow_Click(object sender, RoutedEventArgs e)
        {
            if (m_speed > 1)
            {
                m_speed = 1;
            }
            else
            {
                if (m_speed == 1)
                {
                    m_speed = -1;
                }
                else
                {
                    m_speed -= 1;
                }
            }
            this.lblPlaySpeed.Content = m_speed + "X";
        }

        private void btnFast_Click(object sender, RoutedEventArgs e)
        {
            if (m_speed < 1)
            {
                m_speed = 1;
            }
            else
            {
                m_speed += 1;
            }
            this.lblPlaySpeed.Content = m_speed + "X";
        }

        #endregion
    }
}
